<script setup>
import HelloWorld from "./components/HelloWorld.vue";
import { computed, ref } from 'vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import { useDark, useToggle } from '@vueuse/core'

const isDark = useDark()
// const toggleDark = useToggle(isDark)


const language = ref('zh-cn')
const locale = computed(() => (language.value === 'zh-cn' ? zhCn : en))

const toggle = () => {
  language.value = language.value === 'zh-cn' ? 'en' : 'zh-cn'
}
const toggleDark=()=>{
  
}
// const locale = zhCn;
// import { ElButton } from 'element-plus'
</script>

<template>
  <el-config-provider :locale="locale">
    <el-button @click="toggleDark">换暗黑背景</el-button>
    <el-button mb-2 @click="toggle">Switch Language</el-button>
    <!-- <app /> --><hello-world></hello-world>
  </el-config-provider>
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
